<template>
	<view class="uni-content padding-lr">
		<view class="cu-list menu sm-border radius">
			<view class="cu-item arrow" @click="toUrl('/pages/help/detail',item.id)" v-for="(item, index) in articleList" :key="index">
				<view class="content">
					<text class="cuIcon-title text-yellow"></text>
					<text>{{ item.title }}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				classify_id:0,
				classifyInfo:[],
				articleList:[]
			};
		},
		onLoad: function (option) {
			this.classify_id = option.id;
			this.getData();
		},
		methods: {
			getData:function(){
				//获取基础参数
				// uni.showLoading({
				// 	title:"数据加载中",
				// 	mask:true
				// })
				let id = this.classify_id;
				let timestamp = this.helper.now();
				let sign = this.helper.setSign(['id='+id,'timestamp='+timestamp]);
				this.helper.req({
					api:"getHelpClassify",
					timestamp:timestamp,
					data:{id:id},
					header:{sign:sign},
					method:'GET',
				}).then(res=>{
					// console.log(res.data);
					this.classifyInfo = res.data.data.classifyInfo;
					this.articleList = res.data.data.articleList;
					uni.setNavigationBarTitle({
						title: this.classifyInfo.name
					});
					
					uni.hideLoading();
				})
			},
			//链接
			toUrl:function(url,id){
				url +='?id='+id;
				// console.log(url);
				uni.navigateTo({
					url: url,
				});	
			},
		},
	};
</script>

<style lang="scss">
	page {
		//background-color: #0F51A0;
	}
</style>
